Skip to content

Fix the Notifications freeze on the iPhone Duo's outer screen - #26341

Merged
jkmassel merged 6 commits into
trunkfrom
jkmassel/cmm-2759-notifications-duo-freeze
Nov 12, 2026
Merged

jkmassel merged 6 commits into
trunkfrom
jkmassel/cmm-2759-notifications-duo-freeze

Conversation

@jkmassel

@jkmassel jkmassel commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a freeze in the Notifications tab on the iPhone Duo's outer screen at accessibility text sizes, and tidies the two notification prompts on that screen. Fixes CMM-2759 / #26340.

Root Cause

The Notifications table header holds the inline push prompt (AppFeedbackPromptView). It centred its buttons across the full width, ignoring the safe area. At AX1 the button row reaches into the 84 pt strip on the right of the Duo's outer screen.

The row also took its margins from the safe area (isLayoutMarginsRelativeArrangement). As the row moved, its safe-area inset changed, which moved the row again. Layout never settled, and the main thread stayed at 100%.

Fix

1. The freeze (AppFeedbackPromptView)

  • Stop the loop: the button row no longer takes margins from the safe area (insetsLayoutMarginsFromSafeArea = false).
  • Stay out of the strip: the text, the buttons and the row's centre are pinned to the prompt's safeAreaLayoutGuide. This matches what Keep filter tab bars inside the side safe area #26209 did for the filter tabs on the same screen.
  • Stack when needed: the check that stacks the buttons now compares their width with the width inside the safe area. It runs again whenever that width changes. Before, it compared against the full width and only ran when the prompt was set up.

The first change alone stops the freeze, but leaves the text and Not now under the strip.

2. The inline prompt's layout

  • Line up with the list: the text is now 20 pt from the safe area, like the section titles below it, instead of 37 pt. This also applies on regular iPhones, where the text now wraps a little later.
  • Measure titles on one line: the stacking check used each button's intrinsicContentSize. A button that has already wrapped its title reports the wrapped width, so the row could stay side by side with Allow notifications on two lines. It now uses sizeThatFits with no width limit.
  • Full-width stacked buttons: when the buttons stack, they span the same width as the text above them and get 12 pt of padding above and below the title instead of 5 pt. Side-by-side buttons are unchanged.
  • Large text: at accessibility text sizes the text is left-aligned, which is easier to read over several lines. A button title that wraps stays centered (in RoundedButton, whose only user is this prompt).

3. The permission sheet (AlertView)

The sheet covers the side strip, but its content still kept clear of it, which left an empty band on the right. AlertView now keeps only the horizontal safe-area inset that both sides share, so the content fills the sheet with even margins. iPhone landscape is unchanged: both sides have the same 62 pt inset there. The sheet's height detent measures at the same width.

At accessibility text sizes, AlertView also leaves out its illustration (the bell here) to give the text room. All five AlertView sheets use that slot for a decorative image, so this applies to each of them. Without the illustration, the sheet drops its half-screen minimum and fits the text and buttons, with the title at the top.

Screenshots

iPhone Duo simulator, outer screen, AX1 text size.

Before This PR
Second visit to Notifications Notifications list after tapping My Site; the app is frozen at 100% CPU and stays on Notifications Notifications list with the push permission sheet shown, no bell, filling the outer screen; 0.7% CPU
Permission sheet Sheet content stops at the side strip, leaving an empty band on the right Sheet content fills the sheet with even margins, no bell at AX1
Inline prompt (first commit vs this PR) Text 37 pt in, Allow notifications wrapped beside Not now Text left-aligned 20 pt from the safe area, buttons stacked at the text's width

The second-visit row is from the app, built from trunk and from this PR, signed in with the fake account from the UI-test fixtures in #26339. A frozen app looks like a working one in a still, so the caption under each image gives the CPU use. On trunk, the screenshot was taken after tapping My Site, which the app ignored. The "before" sheet is from the app too.

The other three images come from a temporary unit test that shows the real views in the test host app on the same Duo simulator. That test is not committed. Sign-in through the fixtures timed out when these were taken, with the old build as well as the new one. The test sets the window's tint to the app's green, as WordPressAppDelegate does; the test host skips that, so without it the sheet's button comes out system blue.

iPhone 18 Pro, portrait, test host:

Sheet, default text size Sheet, AX1 Inline prompt, AX1 Inline prompt, AX5
iPhone 18 Pro permission sheet with the usual margins and the bell iPhone 18 Pro permission sheet at AX1 without the bell Inline prompt with stacked buttons spanning the text's width Inline prompt at AX5: left-aligned text, wrapped button title centered

Every AlertView sheet

The AlertView change reaches all five sheets that use it, so each one was rendered on both simulators at the default text size and AX1. Click an image for the full size.

The notifications sheet comes from its real factory. The other four are built in private methods that need a real post or site, so the test rebuilds them from the same SwiftUI code and English text.

Notifications permission Save Posts for Later XML-RPC Disabled Blogging Reminders Reminders set
Duo, default Notifications permission sheet, Duo, default Save Posts for Later sheet, Duo, default XML-RPC Disabled sheet, Duo, default Blogging Reminders sheet, Duo, default Reminders set sheet, Duo, default
Duo, AX1 Notifications permission sheet, Duo, AX1 Save Posts for Later sheet, Duo, AX1 XML-RPC Disabled sheet, Duo, AX1 Blogging Reminders sheet, Duo, AX1 Reminders set sheet, Duo, AX1
iPhone 18 Pro, default Notifications permission sheet, iPhone 18 Pro, default Save Posts for Later sheet, iPhone 18 Pro, default XML-RPC Disabled sheet, iPhone 18 Pro, default Blogging Reminders sheet, iPhone 18 Pro, default Reminders set sheet, iPhone 18 Pro, default
iPhone 18 Pro, AX1 Notifications permission sheet, iPhone 18 Pro, AX1 Save Posts for Later sheet, iPhone 18 Pro, AX1 XML-RPC Disabled sheet, iPhone 18 Pro, AX1 Blogging Reminders sheet, iPhone 18 Pro, AX1 Reminders set sheet, iPhone 18 Pro, AX1

On every sheet, the content spans the Duo's outer screen with even margins, the illustration shows at the default size and is left out at AX1, and nothing is cut off. The title and description start at slightly different distances from the left edge from sheet to sheet, because the text is centred at the width of its longest line. Trunk does the same; this PR doesn't change how that text is laid out.

Test plan

  • Freeze gone: fresh iPhone Duo simulator (iOS 27.1), AX1, Jetpack Debug built with Xcode 27.1, sign in, Not Now on Enable Notifications, open Notifications, switch tab, open Notifications again. Trunk: 98% CPU, sample shows viewDidLayoutSubviews → layoutHeaderView, My Site tap ignored. This PR's first commit: ~1% CPU, the permission sheet appears, and tab switching works.
  • Inline prompt on the Duo at AX1: the text sits 20 pt inside the safe area, and the buttons stack at the text's width with taller padding (test host render, see above).
  • Inline prompt on an iPhone 18 Pro: at AX1 and AX5 the text is left-aligned and the buttons stack at the text's width; at AX5 the wrapped Allow notifications title is centered. At the default text size the text is centered and the buttons stay side by side (test host renders).
  • Permission sheet on the Duo: content spans the sheet with even margins (test host render).
  • No illustration at accessibility sizes: at AX1 the bell is gone and the sheet fits its text and buttons, on the Duo and the iPhone 18 Pro. Same at AX5 on the iPhone. At the default size the bell and the half-screen sheet are unchanged (test host renders).
  • Every AlertView sheet: all five sheets rendered on the Duo and the iPhone 18 Pro, at the default text size and AX1 (test host, see the table above). Each fills the width with even margins, shows its illustration at the default size and leaves it out at AX1, and nothing is cut off.
  • Sheet on a regular iPhone: a single-file test app with the same modifiers keeps the margins in portrait. In landscape the content settles at the same 62 pt inset as before. The real sheet in the test host looks as before in portrait on an iPhone 18 Pro.
  • Unit tests: new AppFeedbackPromptViewTests (Swift Testing, 84 pt right inset): Test run with 3 tests in 1 suite passed. Against trunk's view, the tests hang instead of failing — the test host ran for 36 minutes until xcodebuild restarted it. The hang wasn't sampled, so it's likely but not proven to be the same loop.
  • swift format and make lint pass on the changed files.
  • Inline prompt on a regular iPhone in the app: iPhone 18 Pro (iOS 27.0), Jetpack built from this PR, signed in with a real WP.com account and the API blocked after sign-in. At the default text size the prompt shows above the filter bar: the text is two centred lines 20 pt from each edge, and the buttons sit side by side. The header grows to fit it (167 pt) and the list starts below, in every run where the prompt was shown, on this PR and on a build with its three source files put back to trunk (where the text starts 37 pt in, as before). No screenshots, because the list behind the prompt shows a real account's notifications.
  • Physical iPhone Duo, the inner screen, and the WordPress app: not checked. No physical Duo was available, and the simulator only models the outer screen.

No release note added, matching the other iPhone Duo fixes (#26207–#26222).

@jkmassel jkmassel added this to the 27.6 milestone Nov 5, 2026
@jkmassel jkmassel self-assigned this Nov 5, 2026
@jkmassel
jkmassel marked this pull request as ready for review November 5, 2026 03:12
@wpmobilebot

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

The push prompt in the Notifications header centred its buttons in the
full width, so at accessibility text sizes they reached into the side
strip on the Duo's outer screen. The button row took its margins from the
safe area, which changed as the row moved, and layout never settled.

Keep the prompt's text and buttons inside its safe area, stop the button
row from taking margins from the safe area, and stack the buttons when
they don't fit inside the safe area.
The sheet covers the side strip, so its content no longer stops at the
strip's safe area. Only the horizontal inset both sides share is kept,
which leaves iPhone landscape unchanged.
Pad the text 20 pt from the safe area, like the section titles, instead
of 37 pt. Measure the buttons' titles on one line when choosing the
axis: a button that has already wrapped reports its wrapped width, so
the row stayed side by side with a wrapped title.
@jkmassel
jkmassel force-pushed the jkmassel/cmm-2759-notifications-duo-freeze branch from 56fd4e7 to f5d8588 Compare November 5, 2026 20:43
Stacked buttons now span the same width as the text above them and get taller padding, instead of hugging their titles.
The text needs the room more than the decoration does, especially on small screens such as the iPhone Duo's outer screen. Without the illustration, the sheet fits its text and buttons instead of keeping its half-screen minimum.
@jkmassel
jkmassel force-pushed the jkmassel/cmm-2759-notifications-duo-freeze branch from f99ded7 to 22d59c5 Compare November 5, 2026 23:34
At accessibility text sizes the text is left-aligned, and a button title that wraps stays centered.
@jkmassel
jkmassel requested a review from crazytonyli November 6, 2026 01:58
@jkmassel
jkmassel added this pull request to the merge queue Nov 12, 2026
Merged via the queue into trunk with commit f84319e Nov 12, 2026
26 checks passed
@jkmassel
jkmassel deleted the jkmassel/cmm-2759-notifications-duo-freeze branch November 12, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants